<?php
$this->title = "信息管理系统后台";
?>
<div id="top" align="center"><img src="../web/images/top1.jpg" width=95% height=100%></div>

<style type="text/css">
	body {
		font-size: 7px;
		padding-top: 20px;
	}
	table {
		font-size: 7px;
	}
	#search
	{
		padding-left: 20px;
	}
	#menu
	{
		padding-left: 30px;
	}
	.sideNav{list-style: none; margin:0; padding:0; }
	.sideNav li{line-height: 24px; background:#fff; border-bottom:1px dashed #ddd;}
	.sideNav li i{width:3px; height:3px; overflow: hidden; background-color:#428bca;  margin:11px 8px 0 0; float:left;}
	.sideNav li a{display:block; padding:8px 10px 8px 20px;}
	.sideNav li a:hover{background-color: #f5f5f5; text-decoration: none;}
	.sideNav li a.on{background-color:#eee; font-weight:bold;}
	.sideNav li:last-child{border-bottom:0 none;}
	.sideTit{font-size:14px; background-color:#337ab7; padding:8px 10px; line-height: 24px; color:#fff; cursor: pointer; margin:0;border-top:2px solid #5395D6;}
	.sideTit i{float:left;width:0; height:0; overflow: hidden;border-width:6px; border-color:transparent; border-top-color:#fff;  border-style:solid; margin:9px 6px 0 0;}
	.sideTit.off{padding-left:13px;}
	.sideTit.off i{border-right-width: 0; border-color:transparent transparent transparent #fff;margin:6px 9px 0 0;}
	.exit{margin-top:10px;}
	.exit a{display: block;}
</style>
<script>
	$(function(){
		window.prettyPrint && prettyPrint();

		var sideNav = $(".sideNav");
		sideNav.on('hidden.bs.collapse', function (o) {
			$(this).prev().addClass("off");
		}).on('shown.bs.collapse', function (o) {
			$(this).prev().removeClass("off");
		}).delegate("a","click", function(){
			sideNav.find("a").removeClass("on");
			$(this).addClass("on");
		});
	});
</script>

<div id="left" class="container" height="1000">
	<div class="row">
		<div class="span2">
			<h3 class="sideTit" data-toggle="collapse" href="#sideNav1" aria-expanded="true" aria-controls="sideNav1">
				<i></i>
				欢迎您，<?=$_SESSION['cms_truename'] == '' ? $_SESSION['cms_username'] : $_SESSION['cms_truename']?>
			</h3>
			<ul class="sideNav collapse in" id="sideNav1">
				<li><a href="<?=ROOT_URL?>admin/logout" target="middle" class="on"><i></i>退出登录</a></li>
			</ul>

			<h3 class="sideTit" data-toggle="collapse" href="#sideNav2" aria-expanded="true" aria-controls="sideNav2">
				<i></i>
				文章管理
			</h3>
			<ul class="sideNav collapse in" id="sideNav2">
				<li><a href="<?=ROOT_URL?>article" target="rightframe" ><i></i>所有文章列表</a></li>
				<li><a href="<?=ROOT_URL?>article/published" target="rightframe" ><i></i>我发布的文章</a></li>
				<?php if($_SESSION['cms_usertype'] != 2){?>
				<li><a href="<?=ROOT_URL?>article/auditing" target="rightframe" ><i></i>待审核的文章</a></li>
				<?php }?>
			</ul>

			<h3 class="sideTit" data-toggle="collapse" href="#sideNav3" aria-expanded="true" aria-controls="sideNav3"><i></i>栏目列表</h3>
			<div class="tree-container">
				<ul id="articleTree" class="ztree"></ul>
			</div>

			<?php if($_SESSION['cms_usertype'] == 4 || $_SESSION['cms_usertype'] == 3){?>
			<h3 class="sideTit" data-toggle="collapse" href="#sideNav4" aria-expanded="true" aria-controls="sideNav4">
				<i></i>
				栏目管理
			</h3>
			<ul class="sideNav collapse in" id="sideNav4">
				<li><a href="<?=ROOT_URL?>article/category" target="rightframe"><i></i>网站栏目管理</a></li>
			</ul>
			<?php }?>

			<?php if($_SESSION['cms_usertype'] == 4){?>
			<h3 class="sideTit" data-toggle="collapse" href="#sideNav5" aria-expanded="true" aria-controls="sideNav5">
				<i></i>
				会员管理
			</h3>
			<ul class="sideNav collapse in" id="sideNav5">
				<li><a href="<?=ROOT_URL?>user" target="rightframe"><i></i>会员管理</a></li>
				<li><a href="<?=ROOT_URL?>user/group" target="rightframe"><i></i>会员组管理</a></li>
			</ul>
			<?php }?>

			<h3 class="sideTit" data-toggle="collapse" href="#sideNav6" aria-expanded="true" aria-controls="sideNav6"><i></i>数据导入</h3>
			<ul class="sideNav collapse in" id="sideNav6">
				<li><a href="<?=ROOT_URL?>importdata" target="rightframe"><i></i>Excel导入</a></li>
			</ul>



		</div>
	</div>
</div>

<div id="right">
	<iframe src="<?=ROOT_URL?>article" name="rightframe" style="border:0;height:165%;width:100%"></iframe>
</div>
<script type="text/javascript">
	function toggle(th) {
		$(th).parent().siblings().toggle();
	}

	$(document).ready(function(){
		// var height = ($(window).height()-143)>$("#left").height()?($(window).height()-143):$("#left").height();
		// //alert(height);
		// $("#left").css("height",height+"px");
		// $("#right").css("height",height+"px");
		// $("#right").css("width",($(window).width()-270)+"px");
		resize();
		$(window).resize(function(){
			resize();
		});

		$("#slidebar li").click(function(){
			$("#slidebar li").removeClass("active");
			$(this).addClass("active");
		});
	});

	function resize(){
		var height = ($(window).height()-143)>$("#left").height()?($(window).height()-143):$("#left").height();
		//alert(height);
		$("#left").css("height",height+"px");
		$("#right").css("height",height+"px");
		$("#right").css("width",($(window).width()-270)+"px");
	}

</script>
